package com.shop.dingdongshoppingapi.controller;

import com.shop.dingdongshoppingapi.dto.ClassifyDto;
import com.shop.dingdongshoppingapi.dto.ShopCarAddDto;
import com.shop.dingdongshoppingapi.service.intf.ClassifyService;
import com.shop.dingdongshoppingapi.vo.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/**
 * Author:小樊
 *
 * @Date:2022/7/2 8:54
 */
@RestController
@RequestMapping("/api/classify/")
@CrossOrigin
@Api(tags = "商品分类")
public class ClassifyController {
    @Resource
    private ClassifyService service;

    @GetMapping("/all.do")
    @ApiOperation("显示所有商品")
    public R all(HttpServletRequest request){
        System.out.println();
        return service.all(request.getIntHeader("ddstoken"));
    }

    @GetMapping("/selectLike.do")
    @ApiOperation("模糊查询商品")
    public R selectLike(String gname){
        return service.selectLike(gname);
    }

}
